==============================
Intracardiac Flow Group Comparison Analysis
==============================
Introduction

This repository contains R code used to generate group-wise and subgroup-wise summary tables and statistical comparisons for the intracardiac flow analysis reported in the manuscript.

The analysis focuses on comparisons among three groups (LI, CWO, T2D) and generates a single Excel table summarizing descriptive statistics and inferential results for each variable.

All analyses are performed in R and rely on a single Excel input file. This pipeline generates tables only and does not produce figures.

==============================
Directory structure

- CardiovascularDiabetology.xlsx
- CardiovascularDiabetology.R
- CardiovascularDiabetology_results.xlsx

CardiovascularDiabetology.xlsx
- Raw input data file
- The analysis uses the sheet named GroupComparison

analysis_script.R
- Main R script
- Performs data loading, group and subgroup assignment, statistical testing, and table generation

CardiovascularDiabetology_results.xlsx
- Output file
- Contains the final summary table for all analyzed variables

==============================
Input data description

Excel sheet
- Sheet name: GroupComparison
- Rows correspond to individual subjects
- Columns contain quantitative variables to be analyzed
- No group or subgroup labels are assumed to be present in the Excel file
- Group and subgroup information is assigned within the analysis script

==============================
Group and subgroup definition

Group definition
- Subjects are classified into three main groups
- Group labels used in the analysis are LI, CWO, and T2D

Subgroup assignment
- Groups are assigned based on row indices after loading the Excel sheet

CWO subgroup
- Rows 1 to 37
- Group label: CWO

T2D subgroup
- Rows 39 to 63
- Group label: T2D

LI subgroup
- Rows 65 to 76
- Group label: LI

Exclusion criteria
- Rows outside the defined ranges are excluded from the analysis
- Only subjects with an assigned group label are included in downstream analyses

==============================
Statistical analysis workflow

For each variable selected from the dataset, the following steps are performed.

Data preparation
- Select the variable and the Group column
- Convert values to numeric
- Remove missing values

Descriptive statistics
- Sample size is calculated for each group
- Mean and standard deviation are computed as Mean plus minus SD
- Median and interquartile range are computed as Median and IQR

Normality testing
- Shapiro Wilk test is performed separately within each group
- Normality is assumed only if all groups pass the test

Group comparison
- If data are normally distributed
- One way ANOVA is performed
- Pairwise t tests are conducted with Holm multiple comparison correction
- If data are not normally distributed
- Kruskal Wallis test is performed
- Dunn post hoc test is conducted with Holm correction

Output formatting
- One row is generated per variable
- Group wise statistics are reported consistently based on distribution
- Overall p value and pairwise p values are included

==============================
Variables analyzed
- Variables are selected by column position after group assignment
- The first column Group is excluded automatically

Variable selection code
- variables <- colnames(analysis_sheet)[2:13]
- The column range can be adjusted depending on the number of variables to include

==============================
Output description
- The final output is a single Excel file named CardiovascularDiabetology_results.xlsx
- Each row corresponds to one variable
- Each row contains the following information
- Variable name
- Summary statistics for LI, CWO, and T2D
- Overall p value
- Pairwise p values for LI vs CWO, LI vs T2D, and CWO vs T2D
- Sample sizes formatted as LI, CWO, and T2D
- This table is intended for direct use in manuscript tables or supplementary materials